#!/usr/bin/env python
# -*- coding:utf-8 -*-
import paramiko

transport = paramiko.Transport(('hostname', 22))
transport.connect(username='root', password='123456')

ssh = paramiko.SSHClient()
ssh._transport = transport  # SSHClient 封装 Transport

stdin, stdout, stderr = ssh.exec_command('df')
print stdout.read()

transport.close()

